<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Dashboard extends CI_Controller {
	
	function __construct()
	{
		parent::__construct();
		$this->load->model('dashboard_model','',TRUE);
			
	}
	
	function index(){
		
		if(!$this->session->userdata('username'))
        {
            $this->load->view('login');
        
		 } else {
		
			$data['products']=$this->dashboard_model->get_products();
			$data['categories']=$this->dashboard_model->get_categories();
			$this->load->view('dashboard',$data);
		}
		
	}
}

?>